﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ControlReceiveMailDaily.ascx.cs" Inherits="UserControl_ControlReceiveMailDaily" %>
<%@ Import Namespace="webapp4U" %>
<script type="text/javascript" src='<%=ResolveUrl("~/Scripts/Validate.js")%>'></script>
<script type="text/javascript">
    $().ready(function () {
        //todo code
        $("#btDangKy").click(function () {
            var txtEmail;
            txtEmail = $("#txtEmail").val();
            if (CheckEmpty(txtEmail) && CheckEmail(txtEmail)) {
                $.ajax({
                    type: "POST",
                    url: '<%=ResolveUrl("~/Service/ServiceLabwell.asmx/InsertToXML")%>',
                    data: "{'Email':'" + txtEmail + "'}",
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function (data) {
                        alert(data.d);
                        $("#txtEmail").val('');
                    }
                });
            }
            else {
                alert('Xin vui lòng nhập đúng địa chỉ mail của bạn');
            }
        });

        //end
    });
 </script>

 <input type="text" size="28" id="txtEmail" value="<%=ResourceManager.GetString("Newsletter_EnterEmail")%>"/>
 <input  type="button" id="btDangKy" value="<%=ResourceManager.GetString("Send")%>"/>